  
  var data = { pagenum: 1, pagesize: 7}

  // ---------------------留言列表---------------
  $.ajax({
    url: 'http://localhost:8888/api/articles',
    data: data,
    success: function(res) { 
        var html = template('tpl-wz', res);
        $('.kr_news_list').append(html);
    }
  });

  // ----------------fanye-----------------
$('.kr_more a').on('click', function() {
    data.pagenum++;
    $.ajax({
        url: 'http://localhost:8888/api/articles',
        data: data,
        success: function(res) {
            var html = template('tpl-wz', res);
            $('.kr_news_list').append(html);
            if(data.pagenum*data.pagesize > res.total) {
                $('.kr_more>a').html('人家是有底线的')
            }
        }
      });
})

template.defaults.imports.format = function(str) {
  return moment(str).fromNow(true);
}